from openai import OpenAI

class Deepseek:
    def __init__(self, api_key):
        self.api_key = api_key
    
    def science_chat(self, prompt):
        # 问答
        client = OpenAI(api_key=self.api_key, base_url="https://api.deepseek.com")

        response = client.chat.completions.create(
            model="deepseek-chat",
            messages=[
                {"role": "system", "content": "You are a helpful assistant"},
                {"role": "user", "content": prompt},
            ],
            stream=False
        )

        return response.choices[0].message.content